import { Module } from 'vuex'
import { RootState } from '../index'
const state = {
  id: 0,
  name: '',
  account: ''
}

export type UserState = typeof state

export const store: Module<UserState, RootState> = {
  namespaced: true,
  state,
  mutations: {
    setUser (state: UserState, user: UserState) {
      state.id = user.id
      state.name = user.name
      state.account = user.account
    }
  }
}
